﻿/*
 *Author: Jeff Liu 
 *
 *Under MIT License
 *jebberwocky@gmail.com
 */
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using CtpGglTranslate.Interface;

namespace CtpGglTranslate.Impl
{
    /// <summary>
    /// By String.GetHashCode();
    /// </summary>
    public class SimpleKeyGen: IKeyGen
    {
        public string getKey(string input)
        {
            if (string.IsNullOrEmpty(input))
                return "";
            return input.GetHashCode().ToString();
        }

        public string getKey(string input, String lang)
        {
            if (string.IsNullOrEmpty(input))
                return "";
            return (input + lang).GetHashCode().ToString();
        }

    }
}
